layui.define(["jquery"],function (exports) {
	var $ = layui.$,
	Screen = function(){
		var t = this;
		t.config = {
			screenW:1920,
			screenH:1080,
		}
	};
	Screen.prototype.set = function (option) {
		var t = this;
		$.extend(true, t.config,option);
		return t;
	},
	Screen.prototype.init = function(option){
		var obj = new Screen();
		var o = obj.set(option);
		tt(o.config);
	}
	var tt = function(o){
		var w = window.innerWidth;
		var h = window.innerHeight;
		if(w < o.screenW){
			var scale = "scale(" + (w/o.screenW) + "," + (h/o.screenH) + ")";
			$("body").css({
				"transform":scale,
				width:o.screenW,
				height:o.screenH,
				'transform-origin':'0 0'
			});
		}else{
			$("body").css({
				transform:'scale(1)',
				width:'100%',
				height:'100%'
			});
		}
	}
	var screen = new Screen();
	screen.init();
	$(window).resize(function(){
		screen.init();
	});
	exports('screen',screen);
})